import { BASE_URL, get, post } from "./request";

interface LOGINDATA {
  // 用户id
  userId: string;
  // 密码
  password: string;
}

interface USER_INFO {
  //电话号码
  phoneNum: string;
  //姓名
  name: string;
  //公司
  company: string;
}

//注册
export function register(obj: USER_INFO) {
  return get("/register", obj);
}

//登录
export function logIn(obj: LOGINDATA) {
  // return post("/logIn", JSON.stringify(obj));
  return get("/logIn", obj);
}

//查询用户信息
export function getUserInfo(id: any) {
  return get(`/user${id}`, id);
}

//权限申请
export function approve(param: any) {
  return get("/approve", param);
}

//权限审批
export function apply(param: any) {
  return get("/apply", param);
}

//查询私募公司列表
export function getHedgeFunds(param: any) {
  return get("/hedgeFund", param);
}

//查询基金列表
export function getFunds(param: any) {
  return get("/fund", param);
}

//查询待审批列表
export function getApproveList(param: any) {
  return get("/approveRecord", param);
}

//查询优选基金列表
export function getHandPickedFunds(param: any) {
  return get("/handPickedFund", param);
}

//基金详情
export function getFundInfo(fundId: any) {
  // return get(`/fund${fundId}`, fundId);
  return get(`/fund/${fundId}/detail`, undefined);
}

//查询历史净值
export function getHistoryNavs(param: any) {
  return get("/nav/nav", param);
}

//查询历史业绩
export function getHistoryAchievements(param: any) {
  return get("/achievement", param);
}
